package inheritancedemo;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

class Base2{
    public int a = 1;
    public int b = 2;
    public void method(){
        System.out.println("Base2::method()");
    }
}

class Derived2 extends Base2{
    public int a = 3;
    public int d = 4;

    public void method(int a){
        System.out.println("Derived2:method" + a);
    }
    //不能载静态方法中使用
//    public static void staticFun(){
//        System.out.println(super.a);
//        System.out.println(super.b);
//        super.method();
//    }

    public void test(){
        System.out.println(super.a);
        System.out.println(super.b);
        super.method();
        method(10);
        System.out.println(super.b);
        System.out.println(d);
        System.out.println(super.a);
        System.out.println(this.a);
    }

}

class Test{
    //Test test = new Test();
}

public class TestDemo3 {
    public static void main(String[] args) {
        Derived2 derived2 = new Derived2();
        derived2.test();
    }
}
